-
-
Notifications
You must be signed in to change notification settings - Fork 420
London | 26-Jan | Gloria Mankrado | Sprint 2 | form control updated #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cyf-onboarding-module ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Form-Controls/index.html
Outdated
|
|
||
| <div> | ||
| <label for="name">Name</label> | ||
| <input type="text" name="name" id="name" placeholder="username" minlength="2" required/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently a user can enter a name consisting of only space characters (e.g., " "). Can you enforce a stricter validation rule using the pattern attribute to disallow any name that contains only space characters?
Form-Controls/index.html
Outdated
| <label for="red">Red</label> | ||
| <input type="radio" name="colour" id="red" value="red" required /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can consider wrapping the input element inside the label tags:
<label>
Red
<input type="radio" name="colour" value="red" required />
</label>
This way, we don't need to use the id and for attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @cjyuan ,
Below are the changes i have made according to the feedback given:
- I’ve wrapped the colour inputs inside their labels
- I’ve also added additional requirements to the name field to prevent the issue " " referred.
Regarding the remaining Lighthouse warning, without using CSS it isn’t possible to increase the physical size of form controls, so I’ve applied the best possible HTML-only solution. According to the bot, however, this scores 100 on Accessibility

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Netlify may be using a different version of Lighthouse or different settings when calculating the accessibility score. I think the browser's score is more reliable.
The no-CSS requirement is unusual in practice, but the fix is not difficult (and a bit silly). Just think of it as a puzzle.
Can you try any of the following options to reach a browser's Lighthouse accessibility score of 100?
- Use CSS (I will accept the use of CSS), or
- Ask ChatGPT "How to overcome the 'Touch targets do not have sufficient size or spacing' problem without using CSS".
|
Hi @cjyuan ,
|
|
You forgot to change label. |
|
All good |


Learners, PR Template
Self checklist
Changelist
##FEEDBACK UPDATES
I’ve wrapped the colour radio inputs inside their labels to improve accessibility and increased the clickable area. I’ve also added a pattern attribute to the name field to prevent space-only input.
Regarding the remaining Lighthouse warning, without using CSS it isn’t possible to increase the physical size of form controls, so I’ve applied the best possible HTML-only solution.
Questions
I have none at the moment.